<div class="uk-layui-form">
	<form class="layui-form" action="/apps/report/design/columnupdate.html">
		<input type="hidden" name="id" value="${col.id!''}">
		<input type="hidden" name="mid" value="${col.modelid!''}">
		<div class="layui-form-item">
			<label class="layui-form-label">指标名称：</label>
			<div class="layui-input-inline">
				<input type="text" maxlength="200" name="title" value="${col.title!''}" required lay-verify="required" placeholder="请输入新指标名称" autocomplete="off" class="layui-input">
			</div>
			
			<label class="layui-form-label">指标类型：</label>
			<div class="layui-input-inline">
				<select name="type" lay-filter="mea_type">
		        	<option value="default">默认</option>
		        	<option value="order" <#if col.type?? && col.type == "order">selected="selected"</#if>>序号</option>
		        	<option value="summary" <#if col.type?? && col.type == "summary">selected="selected"</#if>>汇总</option>
		        	<option value="alias" <#if col.type?? && col.type == "alias">selected="selected"</#if>>别称</option>
		        </select>
			</div>
		</div>
		
		<div class="layui-form-item mea_sum" style="<#if !(col.type?? && col.type == "summary")>display:none</#if>">
			<label class="layui-form-label">汇总层级：</label>
			<div class="layui-input-inline">
				<select name="prefix">
		        	<option value="">默认</option>
		        	<#if levels??>
		        	<#list levels as level>
		        	<option value="${level.title!''}" <#if col.prefix?? && col.prefix == level.title>selected="selected"</#if>>${level.title!''}</option>
		        	</#list>
		        	</#if>
		        </select>
			</div>
			
			<label class="layui-form-label">调整位置：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="sort" lay-skin="switch" value="1" <#if col.sort?? && col.sort>checked="checked"</#if> lay-text="启用|禁用">
			</div>
		</div>
		<div class="layui-form-item mea_sum" style="<#if !(col.type?? && col.type == "summary")>display:none</#if>">
			<label class="layui-form-label">汇总类型：</label>
			<div class="layui-input-inline">
				<select name="value" lay-filter="val_filter">
		        	<option value="">默认</option>
		        	<option value="sum" <#if col.value?? && col.value == "sum">selected="selected"</#if>>小计</option>
		        	<option value="prop" <#if col.value?? && col.value == "prop">selected="selected"</#if>>占比</option>
		        	<option value="cus" <#if col.value?? && col.value == "cus">selected="selected"</#if>>自定义</option>
		        </select>
			</div>
			
			<label class="layui-form-label val_mea" <#if !(col.value?? && col.value == "prop")>style="display:none"</#if>>占比层级：</label>
			<div class="layui-input-inline val_mea" <#if !(col.value?? && col.value == "prop")>style="display:none"</#if>>
				<select name="suffix">
		        	<option value="">默认</option>
		        	<#if levels??>
		        	<#list levels as level>
		        	<option value="${level.title!''}" <#if col.suffix?? && col.suffix == level.title>selected="selected"</#if>>${level.title!''}</option>
		        	</#list>
		        	</#if>
		        </select>
			</div>
		</div>
		<div class="layui-form-item mea_sum" style="<#if !(col.type?? && col.type == "summary")>display:none</#if>">
			<label class="layui-form-label">单元格：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="seldata" lay-skin="switch" value="1" <#if col.seldata?? && col.seldata>checked="checked"</#if> lay-text="合并|不合并">
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">空值替换：</label>
			<div class="layui-input-inline">
				<input type="text" name="placeholder" autocomplete="off"
					class="layui-input" value="${col.placeholder!''}">
			</div>
			<label class="layui-form-label">格式化：</label>
			<div class="layui-input-inline">
				<select name="format">
					<option value="">默认</option>
					<option value="####" <#if col.format?? && col.format == "####">selected="selected"</#if>>####</option>
					<option value="0.0" <#if col.format?? && col.format == "0.0">selected="selected"</#if>>0.0</option>
					<option value="0.00" <#if col.format?? && col.format == "0.00">selected="selected"</#if>>0.00</option>
					<option value="0.000" <#if col.format?? && col.format == "0.000">selected="selected"</#if>>0.000</option>
					<option value="##0%" <#if col.format?? && col.format == "##0%">selected="selected"</#if>>##0%</option>
					<option value="##0.0%" <#if col.format?? && col.format == "##0.0%">selected="selected"</#if>>##0.0%</option>
					<option value="##0.00%" <#if col.format?? && col.format == "##0.00%">selected="selected"</#if>>##0.00%</option>
					<option value="###,###" <#if col.format?? && col.format == "###,###">selected="selected"</#if>>###,###</option>
					<option value="###,###.0" <#if col.format?? && col.format == "###,###.0">selected="selected"</#if>>###,###.0</option>
					<option value="###,###.00" <#if col.format?? && col.format == "###,###.00">selected="selected"</#if>>###,###.00</option>
					<option value="###,###.000" <#if col.format?? && col.format == "###,###.000">selected="selected"</#if>>###,###.000</option>
				</select>
			</div>
	  	</div>
	  	<div class="layui-form-button" >
			<div class="layui-button-block">
				 <button class="layui-btn layui-btn-normal"   lay-submit>立即提交</button>
			</div>
		</div>
	</form>
</div>
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  form.render(); //更新全部
  form.on('select(mea_type)', function(data){
		if(data.value == "summary"){
			$('.mea_sum').show();
		}else{
			$('.mea_sum').hide();
		}
  }); 
  form.on('select(val_filter)', function(data){
		if(data.value == "prop"){
			$('.val_mea').show();
		}else{
			$('.val_mea').hide();
		}
  }); 
  
});
</script>